#include "ntc3950.h"

//resistance 阻值 欧姆
float NTC3950GetTemp(uint16_t resistance)
{
    float temp;
    temp = log(resistance / NTC_R0);     // ln(R/R0)
    temp /= NTC_B0;                      // ln(R/R0)/B
    temp += 1.0 / NTC_T0;                // 1/T0 + ln(R/R0)/B
    temp = 1.0 / temp;                   // Invert
    return (temp-273.15);                // 返回绝对温度
}
